#include "thread_pool.hpp"
#include "Task.hpp"

#include <time.h>
#include <cstdlib>
#include <unistd.h>

using namespace ns_threadpool;
using namespace ns_task;

int main()
{
    ThreadPool<Task> *tp = new ThreadPool<Task>(3);
    tp->InitThreadPool();
    srand((long long)time(nullptr));
    const std::string ops = "+-*/%";

    while (true)
    {
        int x = rand() % 20 + 1;
        int y = rand() % 10 + 1;
        char op = ops[rand() % 5];
        Task t(x, y, op);
        tp->PushTask(t);
        
        sleep(1);
    }

    return 0;
}